﻿using PLM.ConfigurationCenter.Model;
using PLM.ConfigurationCenter.SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PLM.ConfigurationCenter.Service {
    /// <summary>
    /// 
    /// </summary>
    public class ServerService {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public List<ServerModel> GetServerModels() {
            var list = DbManager.DbContext.Queryable<ServerModel>().ToList();
            return list;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static int InserServerModel(ServerModel model) {
            var res = DbManager.DbContext.Insertable(model).ExecuteCommand();
            return res;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static int UpdateServerModel(ServerModel model) {
            var res = DbManager.DbContext.Updateable(model).ExecuteCommand();
            return res;
        }
    }
}
